POV-Ray : Newsgroups : povray.general : Rotate list : Re: Rotate list Server Time
7 Aug 2024 11:24:50 EDT (-0400)
  Re: Rotate list  
From: Bill DeWitt
Date: 24 Nov 2001 08:00:00
Message: <3bff99d0$1@news.povray.org>
"Tom Bates" <tho### [at] shawca> wrote :
>
> Bill, what kind of macros are these?
>
> Do they actually do the rotations, like this:
>
> #macro zxy(pz,px,py)
>   rotate pz*z
>   rotate px*x
>   rotate py*y
> #end
>
> object { MyObject
>   zxy(30,45,-60)
> }

    Yes, almost exactly this. But I do it

#macro zxy(ZEE, EKS, WHY)
   rotate z*ZEE
   rotate< EKS, WHY, 0>
#end

    ...which has the same effect.

> Or, do they create a vector that can be used for the correct rotation,
like
> this:
>
> #macro zxy(pz,px,py)
>   #local rx = ????;
>   #local ry = ????;
>   #local rz = ????;
>   // I don't know what goes here, I'm working on it.
>   <rx,ry,rz>
> #end
>
> object { MyObject
>   rotate zxy(30,45,-60)
> }
>
> Obviously, the first one is easier to do, but the second one is what I'm
> trying to figure out.
>
> Do you have some help for me?

    Er... no... not off the top of my head, but I can see some benefit to
that though. You can predefine rotations and then change them.

#if (INT < VAR)
#declare ROT = <30, 40, 50>;
#else
#declare ROT = zxy(30, 60, 90)
#end

object { OBJ rotate ROT }

    I'll think about it and get back to you.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.